package com.hzhk.happyrent.ui.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.hzhk.happyrent.R;
import com.hzhk.happyrent.ui.activity.bill.BillActivity;
import com.hzhk.happyrent.ui.activity.personal.AddressActivity;

import butterknife.BindView;

/**
 * Created by ss on 2017/12/21.
 */

public class DataNullAdapter extends BaseAdapter {
    TextView infoCue;
    private Context context;

    public DataNullAdapter(Context context) {
        this.context = context;
    }

    @Override
    public int getCount() {
        return 1;
    }

    @Override
    public Object getItem(int i) {
        return i;
    }

    @Override
    public long getItemId(int i) {
        return i;
    }

    @Override
    public View getView(int i, View convertView, ViewGroup viewGroup) {
        convertView = LayoutInflater.from(context)
                .inflate(R.layout.layout_no_resoult, null);
        infoCue=convertView.findViewById(R.id.info_cue);
        messageSetting();
        return convertView;
    }

    private void messageSetting() {
        if (context instanceof AddressActivity) {
            infoCue.setText("暂无收货地址");
        }else if(context instanceof BillActivity){
            infoCue.setText("暂无交租");
        }
    }
}
